package com.yc.url;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;

/**
 * @author zwei
 * @create 2024-07-20 15:23
 */
public class Test3_udp_sender {
    public static void main(String[] args) throws IOException {
        String s="中文";
        DatagramPacket dp=new DatagramPacket(s.getBytes(),s.getBytes().length,new InetSocketAddress("127.0.0.1",3333));
        DatagramSocket ds=new DatagramSocket(15648);
        ds.send(dp);
        ds.close();
        System.out.println("发送成功");
    }
}
